﻿
Ext.define('SHApp.System.RolePer.Grid', {
    extend: 'Ext.panel.Panel',
    alias: 'shapp.system.user.grid',
    requires: ['SHApp.Sys.Role.Grid', 'SHApp.Sys.Function.Grid'],
    layout: { type: "border" },
    pvalue: 0,
    initComponent: function () {
        var me = this;
        Ext.apply(this);
        this.createItem();
        this.callParent(arguments);
    },
    createItem: function () {
        var me = this;
        me.items = [
            {
                width: 200,
                region: "west",
                split: true,
                xtype: 'rolegrid',
                pvalue: me.pvalue,
                id: "rolePerID",
                title: "角色管理",
                height: "100%",
                listeners: {
                    selectionchange: function (model, records) {
                        if (records[0]) {
                            var grid = Ext.getCmp("permissonID");
                            grid.loadByRoleID(records[0].data.Id, records[0].data.Name);

                        }
                    }
                }
            }, {
                pvalue: me.pvalue,
                flex: 1,
                region: "center",
                xtype: 'funcgrid',
                id: "permissonID",
                title: "权限分配",
                height: "100%"
            }
        ];
    }


})

